<template>
	<view>
		<uni-nav-bar statusBar @clickLeft='clickLeft()' @clickRight="clickRight(0)" :border='border' color="#000000"
			fixed backgroundColor='#FFFFFF00' left-icon="left" :title="navTitle">

		</uni-nav-bar>
		<view class="topView">
			<view class="topView1"></view>
			<view class="infoView">
				<view v-for="(item,index) in list" :key="index">
					<view @click="itemClick(item)" class="item flex-row-space-between">
						<view class="name">
							{{item.name}}
						</view>
						<view class="flex-row-flex-end">

							<image class="arrow" src="/static/common/arrow.png" mode=""></image>
						</view>

					</view>
				</view>
			</view>

			<view class="infoView">
				<view v-for="(item,index) in list1" :key="index">
					<view @click="itemClick(item)" class="item flex-row-space-between">
						<view class="name">
							{{item.name}}
						</view>
						<view class="flex-row-flex-end">
							<view class="value">
								{{item.value}}
							</view>
							<image class="arrow" src="/static/common/arrow.png" mode=""></image>
						</view>

					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	// import {
	// 	mutations as uniIdMutations
	// } from '@/uni_modules/uni-id-pages/common/store.js'
	export default {
		components: {},
		computed: {

		},
		data() {
			return {
				border: false,
				navTitle: '设置',
				type: 0,
				list: [{
						name: '更换手机号',
						value: '',
						url: 'changePhone'
					},
					{
						name: '个人资料',
						value: '',
						url: 'info?type=0'
					},
				],
				list1: [{
					name: '退出登录',
					value: '',
					url: ''
				}, ],
				userinfo: {}

			}
		},
		onShow() {

		},
		onLoad(e) {
			this.userinfo = uni.getStorageSync('userinfo')
		},

		methods: {
			showToast(title) {
				uni.showToast({
					title: title,
					icon: 'none'
				})
			},
			itemClick(item) {
				if (item.name == '退出登录') {
					uni.showModal({
						title: '提示',
						content: '是否退出账号?',
						success: function(res) {
							if (res.confirm) {
								uni.removeStorageSync('token')
								// uniIdMutations.logout()
								uni.navigateTo({
									url: '/pages/login/login'
								})
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				} else {
					uni.navigateTo({
						url: item.url
					})
				}

			},
			clickLeft() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F5F6F7;
	}

	.infoView {
		margin: 30rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		opacity: 1;
	}

	.item {
		margin: 0 30rpx;
		height: 100rpx;
	}

	.name {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		// font-weight: 500;
		color: #3D3D3D;
	}

	.value {
		margin-right: 20rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		// font-weight: 400;
		color: #999999;
	}

	.headImage {
		margin-right: 20rpx;
		width: 48rpx;
		height: 48rpx;
		border-radius: 50%;
	}
</style>
